快速估计带有高维固定效应的泊松模型, 这计算速度真快, 真实用!
凡是搞计量经济的,都关注这个号了
稿件:econometrics666@126.com
关于Stata相关技能,各位学者可以参阅如下文章:1.Stata16新增功能有哪些? 满满干货拿走不谢,2.Stata资料全分享,快点收藏学习,3.Stata统计功能、数据作图、学习资源等,4.Stata学习的书籍和材料大放送, 以火力全开的势头,5.史上最全Stata绘图技巧, 女生的最爱,6.把Stata结果输出到word, excel的干货方案,7.编程语言中的函数什么鬼?Stata所有函数在此集结,8.世界范围内使用最多的500个Stata程序,9.6张图掌握Stata软件的方方面面, 还有谁, 还有谁?,10.LR检验、Wald检验、LM检验什么鬼?怎么在Stata实现,11.Stata15版新功能,你竟然没有想到,一睹为快,12."高级计量经济学及Stata应用"和"Stata十八讲"配套数据,13.数据管理的Stata程序功夫秘籍,14.非线性面板模型中内生性解决方案以及Stata命令,15.把动态面板命令讲清楚了,对Stata的ado详尽解释,16.半参数估计思想和Stata操作示例,17.Stata最有用的points都在这里,无可替代的材料,18.PSM倾向匹配Stata操作详细步骤和代码,干货十足,19.随机前沿分析和包络数据分析 SFA,DEA 及Stata操作,20.福利大放送, Stata编程技巧和使用Tips大集成,21.使用Stata进行随机前沿分析的经典操作指南,22.Stata, 不可能后悔的10篇文章, 编程code和注解,23.用Stata学习Econometrics的小tips, 第二发礼炮,24.用Stata学习Econometrics的小tips, 第一发礼炮,25.广义合成控制法gsynth, Stata运行程序release,26.多重中介效应的估计与检验, Stata MP15可下载,27.输出变量的描述性统计的方案,28.2SLS第一阶段输出, 截面或面板数据及统计值都行,29.盈余管理指标的构建及其Stata实现程序, 对应解读和经典文献,30.Python, Stata, R软件史上最全快捷键合辑!,31.用Stata做面板数据分析, 操作代码应有尽有,32.用Stata做面板数据分析, 操作代码应有尽有,33.没有这5个Stata命令, 我真的会活不下去!34.第一(二)卷.Stata最新且有趣的程序系列汇编,35.第三卷.Stata最新且急需的程序系列汇编,36.第四卷.Stata最新且急需的程序系列汇编,37.干货: UN和WTO推荐的最全且权威的实证研究方法及在Stata实现!必收藏!
关于下方文字内容,作者:伊凌雪,海南大学&中央财经大学会计(税务)学,通信邮箱:yilingxue@hainanu.edu.cn
Correia, S., Guimarães, P., & Zylkin, T. (2020). Fast Poisson estimation with high-dimensional fixed effects.
In this article, we present ppmlhdfe, a new command for estimation of (pseudo-)Poisson regression models with multiple high-dimensional fixed effects (HDFE). Estimation is implemented using a modified version of the iteratively reweighted least-squares algorithm that allows for fast estimation in the presence of HDFE. Because the code is built around the reghdfe package (Correia, 2014, Statistical Software Components S457874, Department of Economics, Boston College), it has similar syntax, supports many of the same functionalities, and benefits from reghdfe’s fast convergence properties for computing high-dimensional leastsquares problems. Performance is further enhanced by some new techniques we introduce for accelerating HDFE iteratively reweighted least-squares estimation specifically. ppmlhdfe also implements a novel and more robust approach to check for the existence of (pseudo)maximum likelihood estimates.
webuse ships, clear xtpoisson acc op_75_79 co_65_69 co_70_74 co_75_79, exposure(service) irr fe nolog
poisson acc op_75_79 co_65_69 co_70_74 co_75_79 i.ship, exp(service) irr vce(robust)
use http://fmwww.bc.edu/RePEc/bocode/e/EXAMPLE_TRADE_FTA_DATA if category=="TOTAL", clear (Example gravity data for ppml_panel_sg (35 countries, 1988-2004, every 4 yrs)) egen imp=group(isoimp) egen exp=group(isoexp)
use http://fmwww.bc.edu/RePEc/bocode/e/EXAMPLE_TRADE_FTA_DATA if /// category=="TOTAL", clear egen imp = group(isoimp) egen exp = group(isoexp) egen pair = group(isoexp isoimp) local accelerate = 1 local crit 1 local iter 0 local last . local inner_tol = 1e-4 while ( crit´ > 1e-8 | ìnner_tol´ >
crit´) {loc ++iter display as text _n "Iteration ìter´ (crit=`crit´) (HDFE tol=ìnner_tol´)" if (ìter´==1) { quietly summarize trade, mean quietly generate double mu = (trade + r(mean)) / 2 quietly generate double eta = log(mu) quietly generate double z = eta + trade / mu - 1 quietly generate double last_z = z quietly generate double reg_z = z } else if (àccelerate´) { quietly replace last_z = z quietly replace z = eta + trade / mu - 1 quietly replace reg_z = z - last_z + z_resid quietly replace fta = fta_resid } else { quietly replace z = eta + trade / mu - 1 quietly replace reg_z = z } Tighten HDFE tolerance if (`crit´ < 10 * ìnner_tol´) { local inner_tol = ìnner_tol´ / 10 } capture drop *resid Perform HDFE weighted least squares quietly reghdfe reg_z [aw=mu], absorb(imp#year exp#year imp#exp) /// residuals(z_resid) keepsing verbose(-1) tolerance(ìnner_tol´) quietly reghdfe fta [aw=mu], absorb(imp#year exp#year imp#exp) /// residuals(fta_resid) keepsing verbose(-1) tolerance(ìnner_tol´) regress z_resid fta_resid [aw=mu], noconstant cluster(pair) noheader predict double resid, resid Update eta = Xb; mu = exp(eta) quietly replace eta = z - resid quietly replace mu = exp(eta) local crit = abs(_b[fta_resid] - `last´) local last = _b[fta_resid] }
use citations example, clear estimates clear ppmlhdfe cit nbaut, a(issn type jel2 pubyear) eststo ppmlhdfe cit nbaut, a(issn#c.year type jel2 pubyear) eststo ppmlhdfe cit nbaut, a(issn#year type jel2 pubyear) eststo estfe *, labels(type "Article type FE" jel2 "JEL code FE" pubyear "Publication year FE" issn "ISSN FE" issn#c.year "Year trend by ISSN" issn#year "ISSN-Year FE")
net sj 20-1 net install st0589 (to install program files, if available) net get st0589 (to install ancillary files, if available)
2.5年,计量经济圈近1000篇不重类计量文章,
可直接在公众号菜单栏搜索任何计量相关问题,
Econometrics Circle
数据系列:空间矩阵 | 工企数据 | PM2.5 | 市场化指数 | CO2数据 | 夜间灯光 | 官员方言 | 微观数据 | 内部数据计量系列:匹配方法 | 内生性 | 工具变量 | DID | 面板数据 | 常用TOOL | 中介调节 | 时间序列 | RDD断点 | 合成控制 | 200篇合辑 | 因果识别 | 社会网络 | 空间DID数据处理:Stata | R | Python | 缺失值 | CHIP/ CHNS/CHARLS/CFPS/CGSS等 |干货系列:能源环境 | 效率研究 | 空间计量 | 国际经贸 | 计量软件 | 商科研究 | 机器学习 | SSCI | CSSCI | SSCI查询 | 名家经验计量经济圈组织了一个计量社群,有如下特征:热情互助最多、前沿趋势最多、社科资料最多、社科数据最多、科研牛人最多、海外名校最多。因此,建议积极进取和有强烈研习激情的中青年学者到社群交流探讨,始终坚信优秀是通过感染优秀而互相成就彼此的。